<template>
  <div>
    <router-view></router-view>
  </div>
</template>

<script>
  import store from './store/index'
  import {
    getQlist
  } from '@/util/apis'

  export default {
    name: 'App',
    components: {

    },
    beforeCreate() {
      let n
      if(this.$route.query.username){
        n = this.$route.query.username
      }else{
        n = sessionStorage.getItem('username')
      }
      let params = {
        username: n
      }
      console.log(params)
      getQlist(params).then((response) => {
        console.log(response)
        store.commit('getQuestion', response)
      }).catch((error) => {
        console.log(error)
      })
    }
  }
</script>

<style>
  a {
    color: #000
  }
</style>